package com.eastmelon.blog.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.eastmelon.blog.dao.ChannelDao;
import com.eastmelon.blog.entity.Channel;
import com.eastmelon.blog.vo.ChannelCount;

@Repository("channelDao")
public class ChannelDaoImpl extends BaseDaoImpl<Channel> implements ChannelDao{
	public ChannelDaoImpl(){
		super.setNs("com.eastmelon.blog.mapper.ChannelMapper");
	}

	@Override
	public Integer maxPPos() {
		return this.getSqlSession().selectOne(getNs()+".maxPPos",null);
	}

	@Override
	public List<Channel> findByPid(Serializable pid) {
		return this.getSqlSession().selectList(getNs()+".findByPid", pid);
	}
	@Override
	public List<Channel> findParent() {
		return this.getSqlSession().selectList(getNs()+".findParent", null);
	}

	@Override
	public Integer maxCPos() {
		return this.getSqlSession().selectOne(getNs()+".maxCPos",null);
	}

	@Override
	public String getChannelName(Serializable id) {
		return this.getSqlSession().selectOne(getNs()+".getChannelName", id);
	}

	@Override
	public List<ChannelCount> findChannelCount() {
		return this.getSqlSession().selectList(getNs()+".findChannelCount");
	}
}
